<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Merchandise extends MY_Controller {
    
    function __construct()
    {
        parent :: __construct();
        $this->lang->load('merchandise', 'chinese');
        $this->load->model('Merchandise_model');
    }

    public function index()
    {
        $this->setHeader('title', '分类');
        $this->navigation();
        
        $parm['where'] = array();
        $thisData['merchandises'] = $this->Merchandise_model->get_merchandises($parm, $this->uri->segment(2), $this->pageLimit);
        
        $thisData['tags'] = $this->tags();
        $thisData['hot'] = $this->hots();
        $thisData['culture'] = $this->culture();
        $thisData['policy'] = $this->policy();
        $thisData['news'] = $this->news();
        
        $this->load->view('merchandise', $thisData);
    }
    
    public function detail()
    {
        $thisData['culture'] = $this->culture();
        $thisData['policy'] = $this->policy();
        $thisData['news'] = $this->news();
        $thisData['merchandises'] = $this->merchandises();
        $thisData['answers'] = $this->answers();
        $thisData['placesymbols'] = $this->placesymbols();
        $thisData['texts'] = $this->Merchandise_model->get_one($this->uri->segment(3));
        
        $this->setHeader('title', '分类');
        $this->setHeader('keywords', '');
        $this->setHeader('description', '');
        $this->navigation();
        
        $this->load->view('merchandise_detail', $thisData);
    }
}